import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";

import ViteComponents, { AntDesignVueResolver } from "vite-plugin-components";
import WindiCSS from 'vite-plugin-windicss'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    //vite按需引入antd
    ViteComponents({
      customComponentResolvers: [AntDesignVueResolver()],
    }),
    WindiCSS(),
  ],
  css: {
    preprocessorOptions: {
      less: {
        javascriptEnabled: true,
      },
    },
  },
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"),
      'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js',
    },
  },
});
